package item;

import com.item.manager.repository.TemplateRepository;

/**
 * Creates item from name. Generally, it should take a generation template for item/items, the easiest case
 * take template from repo and create an item.
 *
 * @author Blind
 */
public class ItemProvider {
    private final TemplateRepository repo;

    public ItemProvider(TemplateRepository repo) {
        this.repo = repo;
    }

    public Item create(String name) {
        return new Item(this.repo.byName(name));
    }
}
